package tjs.study.notes.mysql.mybatis;


import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import tjs.study.notes.mysql.mybatis.srevice.DoTestService;
import tjs.study.notes.mysql.mybatis.srevice.TransactionalEventListenerTest;

/**
 * Created by Nicky.Tang on 2022/7/2 下午3:27
 *
 * @since 02.12.10
 */
@MapperScan("tjs.study.notes.mysql.mybatis.mapper") //扫描的mapper
@SpringBootApplication(scanBasePackages = {"tjs.study.notes.mysql.mybatis"}
, exclude = {})
@EnableTransactionManagement(proxyTargetClass = true)
public class DoTest implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(DoTest.class, args);
    }
    @Autowired
    private DoTestService doTestService;
    @Autowired
    private TransactionalEventListenerTest transactionalEventListenerTest;

    @Override
    public void run(String... args) throws Exception {
        //doTestService.init(100l);
        //doTestService.testInsertIgnore(5);
        transactionalEventListenerTest.testTransactionalEventListener();
    }

  
}
